

def getMapBytxt(filepath):
    print("读取文本")

    lines = open(filepath).read().splitlines()

    map = {}
    for i in range(len(lines)):
        l = lines[i]
        ll = l.split("\t")
        map.update({ll[0]:ll[1]})
    print(map)



if __name__ == '__main__':

    getMapBytxt(filepath='数据测试集\\读取文本文件按空格分割成两列转化成map结构.txt')